# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=linux-inject
pkgver=100.268d4e4
pkgrel=1
pkgdesc='Tool for injecting a shared object into a Linux process.'
groups=('blackarch' 'blackarch-backdoor' 'blackarch-binary')
arch=('x86_64')
url='https://github.com/gaffe23/linux-inject'
license=('GPL2')
depends=('lib32-gcc-libs' 'gcc-libs')
makedepends=('clang' 'git' 'make')
source=("git+https://github.com/gaffe23/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  make
}

package() {
  cd $pkgname

  install -Dm 755 inject "$pkgdir/usr/bin/$pkgname"
  install -Dm 755 inject32 "$pkgdir/usr/bin/$pkgname-32"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" slides_BHArsenal2015.pdf \
    README.md
  install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

